package models

import (
	"go-caipu/pkg/services/dto"
)

type Datasource struct {
	Id             int64  `json:"id" gorm:"primaryKey;autoIncrement;comment:主键编码"`
	Version        string `json:"version" gorm:"type:bigint;comment:更新版本"`
	Type           string `json:"type" gorm:"type:varchar(100);comment:数据源类型"`
	Name           string `json:"name" gorm:"type:varchar(255);comment:名称"`
	Access         string `json:"access" gorm:"type:varchar(255);comment:访问对象"`
	Url            string `json:"url" gorm:"type:varchar(100);comment:配置地址"`
	IsDefault      int    `json:"isDefault" gorm:"type:int;comment:是否默认"`
	JsonData       []byte `json:"jsonData" gorm:"type:varchar(600);comment:配置json串"`
	SecureJsonData string `json:"secureJsonData" gorm:"column:secure_json_data;type:varchar(600);comment:加密配置"`
	ReadOnly       string `json:"readOnly" gorm:"type:varchar(64);comment:是否只读"`
	dto.ControlBy
	dto.ModelTime
}

func (Datasource) TableName() string {
	return "sys_plugin_datasource"
}
